Charger Reservation [SOFT]
Connect URL
THIS IS A SECRET. MESSAGE A DEV.
Reserving a Charger
-
The client connects to the websocket.
-
Upon connecting, the client sends a message with
command
set toSTART
.- If there is an existing reservation within the time limit, an error will be thrown.
- If there is an existing reservation past the time limit, the reservation will be overwritten.
- If the client disconnects without sending
HOLD
prior, the reservation will be cancelled. - If the charger is not
Preparing
, an error will be thrown.
-
Before paying, the client sends a message with
command
set toHOLD
.- If reservation does not exist, an error will be thrown.
- If a different user email tries to hold the reservation, an error will be thrown.
- If the reservation is not active, an error will be thrown.
-
Upon returning, the client sends a message with
command
set toRESUME
.- If reservation does not exist, an error will be thrown.
- If a different user email tries to hold the reservation, an error will be thrown.
- If the reservation is not on hold, an error will be thrown.
-
[Optional] Upon returning, the client sends a message with
command
set toCANCEL
.- If reservation does not exist, an error will be thrown.
- If a different user email tries to hold the reservation, an error will be thrown.
ReserveChargerRequestDTO
This should be the message of the request from the client.
Attributes:
Name | Type | Description |
---|---|---|
command |
Annotated[Command, BeforeValidator(get)]
|
SHOULD BE ONE OF THE ENUM |
site_id |
int
|
SITE OF CHARGER TO RESERVE |
charger_id |
str
|
CHARGER TO RESERVE |
connector_id |
int
|
CONNECTOR TO BE USED WITHIN THE CHARGER |
email |
str
|
EMAIL OF RESERVER |
Command
Attributes:
Name | Type | Description |
---|---|---|
START |
USED UPON CONNECTING TO THE WEBSOCKET |
|
HOLD |
USED JUST BEFORE PAYMENT REDIRECTION |
|
RESUME |
USED AFTER PAYING |
|
CANCEL |
USED TO CANCEL RESERVATION |
Error
Attributes:
Name | Type | Description |
---|---|---|
INVALID_COMMAND |
INVALID |
|
EXISTING_RESERVATION |
THERE IS AN EXISTING CHARGER RESERVATION |
|
NON_EXISTING_RESERVATION |
THERE IS NO EXISTING CHARGER RESERVATION |
|
DIFFERENT_USER_EMAIL |
DIFFERENT USER IS TRYING TO INTERACT WITH THE RESERVATION |
|
CHARGER_NOT_PREPARING |
CHARGER IS NOT IN PREPARING STATUS |
|
CHARGER_RESERVATION_NOT_HOLDABLE |
CHARGER RESERVATION IS NOT HOLDABLE |
|
CHARGER_RESERVATION_NOT_RESUMEABLE |
CHARGER RESERVATION IS NOT RESUMEABLE |